package com.jshcbd.modules.system.service.impl;

import com.jshcbd.common.constant.CommonConstant;
import com.jshcbd.common.util.MinioUtil;
import com.jshcbd.common.util.OssBootUtil;
import com.jshcbd.modules.system.service.ISysBaseAPI;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author zhoucd
 * @date
 * @description
 */
@Slf4j
@Service
public class SysBaseApiImpl implements ISysBaseAPI {
    @Override
    public String upload(MultipartFile file, String bizPath, String uploadType) {
        String url = "";
        if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){
            url = MinioUtil.upload(file,bizPath);
        }else{
            url = OssBootUtil.upload(file,bizPath);
        }
        return url;
    }
}
